package com.example.democlient.network.clientpackets;

import android.app.Activity;
import android.os.Message;
import com.example.democlient.MainActivity;
import com.example.democlient.network.packet.ClientPacket;

public class CM_USER_AUTH_RESPONSE extends ClientPacket {

    private int response;
    private static final Class<? extends Activity> calssz = MainActivity.class;
    public CM_USER_AUTH_RESPONSE(int opcode) {
        super(opcode);
    }

    @Override
    protected void readImpl() {
    	this.response = readC();
    }

    @Override
    protected void runImpl() {
    	//Handler handler = super.getHandler();
    	System.out.println("服务器返回代码:"+response);
    	//
        switch (response) {
        	case 1:
        		Message msg = new Message();
        		msg.what=1;
        		msg.obj = readS();
        		super.getApp().getHander(calssz).sendMessage(msg);
        		break;
        	default:
        		super.getApp().getHander(calssz).sendEmptyMessage(response);
                break;
        }
    }
}
